home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickDraw3D 1.6 SDK / Mac SampleCode New for 1.6 / FogStyleSample / Source / Main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-18  |  2.0 KB  |  107 lines  |  [TEXT/CWIE]

  1. /****************************/
  2. /*  FOG TEST                */
  3. /* By Brian Greenstone      */
  4. /****************************/
  5.  
  6.  
  7. /****************************/
  8. /*    EXTERNALS             */
  9. /****************************/
  10. #include <Gestalt.h>
  11.  
  12. #include "myglobals.h"
  13. #include "qd3d_support.h"
  14. #include "mymenus.h"
  15. #include "myevents.h"
  16. #include "misc.h"
  17. #include "3dmf.h"
  18. #include "process.h"
  19.  
  20. extern    QD3DSetupOutputType        gModelViewInfo;
  21.  
  22. /****************************/
  23. /*    PROTOTYPES            */
  24. /****************************/
  25.  
  26. static    void ToolBoxInit(void);
  27.  
  28.  
  29. /*****************/
  30. /* TOOLBOX INIT  */
  31. /*****************/
  32.  
  33. static void ToolBoxInit(void)
  34. {
  35. TQ3Status    myStatus;
  36. long response;
  37.  
  38.      MaxApplZone();
  39.     InitGraf(&qd.thePort);
  40.     FlushEvents ( everyEvent, REMOVE_ALL_EVENTS);
  41.     InitFonts();
  42.     InitWindows();
  43.     InitDialogs(nil);
  44.     InitCursor();
  45.     InitMenus();
  46.     TEInit();
  47.     
  48.             /* SEE IF QD3D AVAILABLE */
  49.     
  50.     if((void *)Q3Initialize == (void *)kUnresolvedCFragSymbolAddress)
  51.         DoFatalAlert("\pQuickDraw 3D version 1.6 or better is required to run this application!");
  52.  
  53.     myStatus = Q3Initialize();
  54.     if ( myStatus == kQ3Failure )
  55.         DoFatalAlert("\pQ3Initialize returned failure.");    
  56.         
  57.     Gestalt(gestaltQD3D, &response);
  58.     if (response & (1<<gestaltQD3DPresent))
  59.     {    
  60.         Gestalt(gestaltQD3DVersion,&response);
  61.         if (response < 0x10600)                        // must be using 1.6 or better
  62.         {
  63. err:        
  64.             DoFatalAlert("\pQuickDraw 3D version 1.6 or better is required to run this application!");
  65.         }
  66.     }
  67.     else
  68.         goto err;
  69. }
  70.  
  71.  
  72.  
  73. /*****************/
  74. /* TOOLBOX EXIT  */
  75. /*****************/
  76.  
  77. static void ToolBoxExit(void)
  78. {
  79. TQ3Status    myStatus;
  80.  
  81.     myStatus = Q3Exit();
  82.     if ( myStatus == kQ3Failure )
  83.         DoFatalAlert("\pQ3Exit returned failure.");                
  84. }
  85.  
  86.  
  87. /************************************************************/
  88. /******************** PROGRAM MAIN ENTRY  *******************/
  89. /************************************************************/
  90.  
  91.  
  92. void main(void)
  93. {
  94.  
  95.     ToolBoxInit();                  
  96.     InitMenuBar();
  97.     InitTest();
  98.  
  99.     while (true)
  100.         HandleEvents();
  101.  
  102.     ToolBoxExit();
  103. }
  104.  
  105.  
  106.  
  107.